SETUID

Section: MINTLIB LIBRARY FUNCTIONS (3)
Updated: 3 March 1993
Index Return to Main Contents
 

NAME

setuid, setgid - set user and group IDs  

SYNOPSIS

#include <unistd.h>

int setuid(int uid);
int setgid(int gid);
 

DESCRIPTION

setuid (setgid) is used to set the real user (group) ID and effective user (group) ID of the calling process. If the effective user ID of the calling process is super-user, the real user (group) ID and effective user (group) ID are set to uid (gid). If the effective user ID of the calling process is not super-user, but its real user (group) ID is equal to uid (gid), the effective user (group) ID is set to uid (gid). setuid (setgid) will fail if the real user (group) ID of the calling process is not equal to uid (gid) and its effective user ID is not super-user.  

RETURN VALUES


 0 on success -1 on failure; errno is set to indicate the error.  

SEE ALSO

getuid(3), getgid(3), geteuid(3), getegid(3), Psetuid(2), Psetgid(2)  

NOTES

The related functions seteuid, setegid, setreuid and setregid are also available in the MiNTlibs but really are the same.  

BUGS

When MiNT is not active, these calls are pretty bogus. Security in MiNT is a joke; don't rely on these calls to actually protect you from anything, it's more for informational purposes.
 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
SEE ALSO
NOTES
BUGS

This document was created by man2html, using the manual pages.
Time: 11:14:53 GMT, June 22, 2025